home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 28
/
Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso
/
Aminet
/
dev
/
lang
/
fpc09905c.lha
/
fpc
/
inc
/
systemh.inc
< prev
next >
Wrap
Text File
|
1998-09-21
|
18KB
|
509 lines
{
$Id: systemh.inc,v 1.24 1998/08/11 21:39:08 peter Exp $
This file is part of the Free Pascal Run time library.
Copyright (c) 1993,97 by the Free Pascal development team
See the File COPYING.FPC, included in this distribution,
for details about the copyright.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************}
{*****************************************************************************
This File contains the OS independent declarations of the system unit
Possible defines:
-----------------
RTLLITE Create a somewhat smaller RTL
*****************************************************************************}
{****************************************************************************
Support for multiple compiler versions
****************************************************************************}
{$i version.inc}
{****************************************************************************
Global Types and Constants
****************************************************************************}
Type
Longint = $80000000..$7fffffff;
Integer = -32768..32767;
shortint = -128..127;
byte = 0..255;
Word = 0..65535;
{ at least declare Turbo Pascal real types }
{$ifdef i386}
{$ifndef VER0_99_5}
{$ifndef VER0_99_6}
{$define DEFAULT_EXTENDED}
{$endif}
{$endif}
{$define SUPPORT_EXTENDED}
{$define SUPPORT_COMP}
{$define SUPPORT_SINGLE}
{$define SUPPORT_FIXED}
Double = real;
{$ifdef DEFAULT_EXTENDED}
ValReal = Extended;
{$else}
ValReal = Double;
{$endif}
{$endif}
{$ifdef m68k}
StrLenInt = Integer;
ValReal = Real;
{$ifdef USEANSISTRINGS}
{$error StrLenInt must be a longint if ansi strings are used}
{$endif}
{$endif}
{$ifdef i386}
StrLenInt = LongInt;
{$endif}
{ some type aliases }
dword = cardinal;
longword = cardinal;
{ Zero - terminated strings }
PChar = ^Char;
PPChar = ^PChar;
{ procedure type }
TProcedure = Procedure;
const
{ max. values for longint and int}
maxLongint = $7fffffff;
maxint = 32767;
{ Compatibility With TP }
{$ifdef i386}
Test8086 : byte = 2; { Always i386 or newer }
Test8087 : byte = 3; { Always 387 or newer. Emulated if needed. }
{$endif i386}
{$ifdef m68k}
Test68000 : byte = 0; { Must be determined at startup for both }
Test68881 : byte = 0;
{$endif}
{ max level in dumping on error }
Max_Frame_Dump : Word = 8;
{ Exit Procedure handling consts and types }
ExitProc : pointer=nil;
Erroraddr: pointer = nil;
Errorcode: Word = 0;
{ file input modes }
fmClosed = $D7B0;
fmInput = $D7B1;
fmOutput = $D7B2;
fmInOut = $D7B3;
fmAppend = $D7B4;
Filemode : byte = 2;
Type TErrorProc = Procedure (ErrNo : Longint; Address : Pointer);
var
{ Standard In- and Output }
Output,
Input,
StdErr : Text;
ExitCode,
InOutRes : Word;
StackBottom,
LowestStack,
RandSeed : Longint;
Const
ErrorProc : Pointer = nil;
{****************************************************************************
Processor specific routines
****************************************************************************}
Procedure Move(Var source,dest;count:Longint);
Procedure FillChar(Var x;count:Longint;Value:Char);
Procedure FillChar(Var x;count:Longint;Value:byte);
{$ifndef RTLLITE}
Procedure FillWord(Var x;count:Longint;Value:Word);
{$endif RTLLITE}
{****************************************************************************
Math Routines
****************************************************************************}
{$ifndef RTLLITE}
Function lo(w:Word):byte;
Function lo(l:Longint):Word;
Function lo(i:Integer):byte;
Function lo(B: Byte):Byte;
Function hi(w:Word):byte;
Function hi(i:Integer):byte;
Function hi(l:Longint):Word;
Function Hi(B : Byte): byte;
Function Swap (X:Word):Word;
Function Swap (X:Integer):Integer;
Function Swap (X:Cardinal):Cardinal;
Function Swap (X:Longint):Longint;
{$ifdef VER0_99_5}
Procedure Inc(Var i:cardinal);
Procedure Inc(Var i:Longint);
Procedure Inc(Var i:Integer);
Procedure Inc(Var i:Word);
Procedure Inc(Var i:shortint);
Procedure Inc(Var i:byte);
Procedure Inc(Var c:Char);
Procedure Inc(Var p:PChar);
Procedure Dec(Var i:cardinal);
Procedure Dec(Var i:Longint);
Procedure Dec(Var i:Integer);
Procedure Dec(Var i:Word);
Procedure Dec(Var i:shortint);
Procedure Dec(Var i:byte);
Procedure Dec(Var c:Char);
Procedure Dec(Var p:PChar);
Procedure Dec(Var i:cardinal;a:Longint);
Procedure Inc(Var i:cardinal;a:Longint);
Procedure Dec(Var i:Longint;a:Longint);
Procedure Inc(Var i:Longint;a:Longint);
Procedure Dec(Var i:Word;a:Longint);
Procedure Inc(Var i:Word;a:Longint);
Procedure Dec(Var i:Integer;a:Longint);
Procedure Inc(Var i:Integer;a:Longint);
Procedure Dec(Var i:byte;a:Longint);
Procedure Inc(Var i:byte;a:Longint);
Procedure Dec(Var i:shortint;a:Longint);
Procedure Inc(Var i:shortint;a:Longint);
Procedure Dec(Var c:Char;a:Longint);
Procedure Inc(Var c:Char;a:Longint);
Procedure Dec(Var p:PChar;a:Longint);
Procedure Inc(Var p:PChar;a:Longint);
{$endif VER0_99_5}
{$endif RTLLITE}
Function Chr(b:byte):Char;
Function Length(s:string):byte;
Function Random(l:Longint):Longint;
Function Random:real;
Procedure Randomize;
Function abs(l:Longint):Longint;
Function sqr(l:Longint):Longint;
Function odd(l:Longint):Boolean;
{ float mathe routines }
{$I mathh.inc}
{****************************************************************************
Memory management
****************************************************************************}
Procedure getmem(Var p:pointer;Size:Longint);
Procedure freemem(Var p:pointer;Size:Longint);
Function memavail:Longint;
Function maxavail:Longint;
{$ifndef RTLLITE}
Function ptr(sel,off:Longint):pointer;
Function Addr (Var X):pointer;
Function Cseg:Word;
Function Dseg:Word;
Function Sseg:Word;
{$endif RTLLITE}
{****************************************************************************
PChar Handling
****************************************************************************}
function strpas(p:pchar):string;
function strlen(p:pchar):longint;
Function Copy(const s:string;index:StrLenInt;count:StrLenInt):string;
Procedure Delete(Var s:string;index:StrLenInt;count:StrLenInt);
Procedure Insert(const source:string;Var s:string;index:StrLenInt);
Function Pos(const substr:string;const s:string):byte;
Function Pos(C:Char;const s:string):byte;
Function upCase(c:Char):Char;
Function upCase(const s:string):string;
{$ifndef RTLLITE}
Function lowerCase(c:Char):Char;
Function lowerCase(const s:string):string;
Function hexStr(Val:Longint;cnt:byte):string;
Function binStr(Val:Longint;cnt:byte):string;
{$endif RTLLITE}
Function Space(b:byte):string;
Procedure Val(const s:string;Var l:Longint;Var code:Word);
Procedure Val(const s:string;Var l:Longint;Var code:Integer);
Procedure Val(const s:string;Var l:Longint);
Procedure Val(const s:string;Var b:byte;Var code:Word);
Procedure Val(const s:string;Var b:byte;Var code:Integer);
Procedure Val(const s:string;Var b:byte);
Procedure Val(const s:string;Var b:shortint;Var code:Word);
Procedure Val(const s:string;Var b:shortint;Var code:Integer);
Procedure Val(const s:string;Var b:shortint);
Procedure Val(const s:string;Var b:Word;Var code:Word);
Procedure Val(const s:string;Var b:Word;Var code:Integer);
Procedure Val(const s:string;Var b:Word);
Procedure Val(const s:string;Var b:Integer;Var code:Word);
Procedure Val(const s:string;Var b:Integer;Var code:Integer);
Procedure Val(const s:string;Var b:Integer);
Procedure Val(const s:string;Var v:cardinal;Var code:Word);
Procedure Val(const s:string;Var v:cardinal;Var code:Integer);
Procedure Val(const s:string;Var v:cardinal);
Procedure